<#import "/admin/_layout.html" as layout>
<@layout.header "页面评论"></@layout.header>
<@layout.body>
    <div class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-left">
                        <li class="breadcrumb-item"><a href="#">评论</a></li>
                        <li class="breadcrumb-item active">编辑</li>
                    </ol>
                </div>
            </div>
        </div>
    </div>
    <section class="content">
        <div class="container-fluid">
            <div class="card card-default">
                <form id="myForm" method="POST" action="/admin/page/comment/doSave" ok="/admin/page/comment/list">
                    <input type="hidden" name="id" value="${(pageComment.id)!}">
                    <div class="card-body">
                        <div class="form-group">
                            <label for="roleName">评论内容</label>
                            <textarea rows="2" name="content" class="form-control" id="content" placeholder="请输入评论内容">${(pageComment.content)!}</textarea>
                        </div>
                        <div class="form-group">
                            <#assign _type=(pageComment.status)!"publish" />
                            <label for="status">状态</label>
                            <select class="form-control" id="status" name="status">
                                <option value="publish" <@selectedIf value=(_type =="publish")/>>发布</option>
                                <option value="hidden" <@selectedIf value=(_type =="hidden")/>>隐藏</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="roleName">排序</label>
                            <input type="number" name="sortNum" class="form-control" id="sortNum" placeholder="请输入评论排序" value="${(pageComment.sortNum)!}">
                        </div>
                    </div>
                    <div class="card-footer">
                        <button type="submit" class="btn btn-primary">提交</button>
                    </div>
                </form>
            </div>
        </div>
    </section>
</@layout.body>
<@layout.script>
    <script>
        $(function () {
            submitForm({
                content: { required: true}
            },{
                content: {required: "请输入评论内容"}
            })
        });
    </script>
</@layout.script>